Bivariate - MA Data Analysis

Correlation b/w dependent vars.(food loss and food waste)

## # A tibble: 3 × 4
##   rowname         food_waste_kg liquid_waste_kg solid_waste_kg
## * <chr>                   <dbl>           <dbl>          <dbl>
## 1 food_waste_kg            1               0.97           0.88
## 2 liquid_waste_kg          0.97            1              0.73
## 3 solid_waste_kg           0.88            0.73           1
## # A tibble: 3 × 4
##   rowname         food_waste_kg liquid_waste_kg solid_waste_kg
##   <chr>                   <dbl>           <dbl>          <dbl>
## 1 food_waste_kg       0               9.85e-100       5.27e-52
## 2 liquid_waste_kg     9.85e-100       0               2.94e-28
## 3 solid_waste_kg      5.27e- 52       2.94e- 28       0

Correlation b/w independent vars.

## # A tibble: 9 × 10
##   rowname   temp_c humi_p prcp_mm  fulls  halfs takeouts customers liquors sales
## * <chr>      <dbl>  <dbl>   <dbl>  <dbl>  <dbl>    <dbl>     <dbl>   <dbl> <dbl>
## 1 temp_c     1      0.094  -0.035  0.25   0.094    0.11      0.24    0.066  0.27
## 2 humi_p     0.094  1       0.35  -0.043 -0.15    -0.03     -0.065  -0.23  -0.11
## 3 prcp_mm   -0.035  0.35    1     -0.19  -0.097   -0.087    -0.16   -0.18  -0.16
## 4 fulls      0.25  -0.043  -0.19   1      0.33     0.15      0.92    0.33   0.8 
## 5 halfs      0.094 -0.15   -0.097  0.33   1        0.19      0.62    0.15   0.5 
## 6 takeouts   0.11  -0.03   -0.087  0.15   0.19     1         0.2     0.2    0.54
## 7 customers  0.24  -0.065  -0.16   0.92   0.62     0.2       1       0.32   0.84
## 8 liquors    0.066 -0.23   -0.18   0.33   0.15     0.2       0.32    1      0.46
## 9 sales      0.27  -0.11   -0.16   0.8    0.5      0.54      0.84    0.46   1
## # A tibble: 9 × 10
##   rowname   temp_c  humi_p prcp_mm    fulls    halfs takeouts customers  liquors
##   <chr>      <dbl>   <dbl>   <dbl>    <dbl>    <dbl>    <dbl>     <dbl>    <dbl>
## 1 temp_c   0       2.34e-1 6.57e-1 1.47e- 3 2.36e- 1 1.62e- 1  2.44e- 3 4.02e- 1
## 2 humi_p   2.34e-1 0       5.74e-6 5.85e- 1 5.28e- 2 7.07e- 1  4.1 e- 1 2.8 e- 3
## 3 prcp_mm  6.57e-1 5.74e-6 0       1.65e- 2 2.21e- 1 2.74e- 1  3.86e- 2 2.47e- 2
## 4 fulls    1.47e-3 5.85e-1 1.65e-2 0        1.58e- 5 6.14e- 2  4.63e-65 2.27e- 5
## 5 halfs    2.36e-1 5.28e-2 2.21e-1 1.58e- 5 0        1.35e- 2  1.07e-18 5.79e- 2
## 6 takeouts 1.62e-1 7.07e-1 2.74e-1 6.14e- 2 1.35e- 2 0         1.18e- 2 1.32e- 2
## 7 custome… 2.44e-3 4.1 e-1 3.86e-2 4.63e-65 1.07e-18 1.18e- 2  0        3.12e- 5
## 8 liquors  4.02e-1 2.8 e-3 2.47e-2 2.27e- 5 5.79e- 2 1.32e- 2  3.12e- 5 0       
## 9 sales    6.34e-4 1.74e-1 4.45e-2 6.76e-37 2.14e-11 9.41e-14  1.32e-44 5.46e-10
## # ℹ 1 more variable: sales <dbl>

Correlation b/w independent vars.

## # A tibble: 6 × 7
##   rowname   temp_c humi_p prcp_mm customers liquors sales
## * <chr>      <dbl>  <dbl>   <dbl>     <dbl>   <dbl> <dbl>
## 1 temp_c     1      0.094  -0.035     0.24    0.066  0.27
## 2 humi_p     0.094  1       0.35     -0.065  -0.23  -0.11
## 3 prcp_mm   -0.035  0.35    1        -0.16   -0.18  -0.16
## 4 customers  0.24  -0.065  -0.16      1       0.32   0.84
## 5 liquors    0.066 -0.23   -0.18      0.32    1      0.46
## 6 sales      0.27  -0.11   -0.16      0.84    0.46   1
## # A tibble: 6 × 7
##   rowname     temp_c     humi_p    prcp_mm customers  liquors    sales
##   <chr>        <dbl>      <dbl>      <dbl>     <dbl>    <dbl>    <dbl>
## 1 temp_c    0        0.234      0.657       2.44e- 3 4.02e- 1 6.34e- 4
## 2 humi_p    0.234    0          0.00000574  4.1 e- 1 2.8 e- 3 1.74e- 1
## 3 prcp_mm   0.657    0.00000574 0           3.86e- 2 2.47e- 2 4.45e- 2
## 4 customers 0.00244  0.41       0.0386      0        3.12e- 5 1.32e-44
## 5 liquors   0.402    0.0028     0.0247      3.12e- 5 0        5.46e-10
## 6 sales     0.000634 0.174      0.0445      1.32e-44 5.46e-10 0
## Correlation computed with
## • Method: 'pearson'
## • Missing treated using: 'pairwise.complete.obs'

Principal Component Analysis

## Standard deviations (1, .., p=6):
## [1] 214.732100   7.765591   3.696578   3.444734   1.566496   1.184341
## 
## Rotation (n x k) = (6 x 6):
##                    PC1         PC2         PC3          PC4          PC5
## customers -0.040159987  0.65415860  0.53926876  0.003558498  0.060251895
## fulls     -0.029860294  0.54164943 -0.15786373  0.636260658  0.041233236
## halfs     -0.007547398  0.08289829  0.54937299 -0.489499360  0.050317942
## takeouts  -0.015212980 -0.51993282  0.60713716  0.592751376  0.096986947
## liquors   -0.003971133 -0.01596434 -0.11378519 -0.060061003  0.991282881
## sales     -0.998594698 -0.03514675 -0.02991606 -0.024260491 -0.009455986
##                     PC6
## customers  0.5253664932
## fulls     -0.5237131815
## halfs     -0.6701632001
## takeouts   0.0078888164
## liquors    0.0230916594
## sales     -0.0006150708
## Standard deviations (1, .., p=3):
## [1] 11.97351  9.37176  1.99279
## 
## Rotation (n x k) = (3 x 3):
##                PC1        PC2         PC3
## temp_c  0.19339715  0.9809830  0.01643034
## humi_p  0.97919789 -0.1919432 -0.06579745
## prcp_mm 0.06139248 -0.0288136  0.99769772

Scatter Plot

FW with temp

FW with humidity

FW with precipitation

FW with customers

FW with sales

FW with liquor

Correlogram

Cross-Correlation